package cn.geminis.workflow.service.utils;

import cn.geminis.workflow.service.controller.vo.Task;
import cn.geminis.workflow.service.entity.ApproveResult;
import org.flowable.bpmn.model.BpmnModel;
import org.flowable.bpmn.model.Process;
import org.flowable.engine.ProcessEngine;
import org.springframework.data.domain.Page;

import java.util.HashMap;
import java.util.List;
import java.util.Objects;

/**
 * @author puddi
 */
public class TaskUtils {

    public static void fillTaskInfo(List<Task> tasks, List<ApproveResult> approves) {
        tasks.forEach(task -> approves.stream()
                .filter(approve -> approve.getTaskInstanceId().equals(task.getId()))
                .findAny()
                .ifPresent(task::setApproveResult));
    }
}
